package com.hualan.controller;

import com.hualan.service.impl.TeacherSearchService;
import com.hualan.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/teacherSearch")
public class TeacherSearchController {
    @Autowired
    private TeacherSearchService teacherSearchService;

    @GetMapping("/getTeacherSearch")
    public R getTeacherSearchByName(String teacherName){
        return R.success(teacherSearchService.findTeacherByName(teacherName));
    }

    @GetMapping("/findAllTeacher")
    public R getAllTeacher(){
        return R.success(teacherSearchService.findAllTeacher());
    }
}
